package com.card.game.room;

import com.card.common.CardContants;
import com.card.setting.GameSetting;

public class RoomSetting {
	public enum RoomMode {
		Round2, // 4局 0
		Round4, // 8局 1
		Ju10, // 牛牛,斗地主 10局 2
		Ju20, // 炸金花,牛牛20局 3
		Ju30, // 炸金花,牛牛30局 4
		Ju4, // 斗地主 5
		Ju8, // 炸金花 6
		Ju16, // 炸金花 7
		Ju32, // 炸金花 8
		Ju5,// 斗地主5局 9
	}

	private int roomType;// 游戏类型 0-麻将 1-炸金花
	private RoomMode roomMode = RoomMode.Round2;

	private int betLimit;// 炸金花限注
	private int userNum = 4;// 本局人数
	private int menNum;// 闷的轮数
	private boolean isAa;// 是否是aa

	// private int zhaDanTop;//炸弹上限
	private int nnType;// 0-无牛下庄 1-轮庄 2-看牌抢庄
	private int beiTop;// 牛牛倍数上线
	private int maxLunNum;
	// 麻将参数
	private boolean isZimoFanFan;// 是否自摸翻翻
	private int hua = 1;// 几底几花
	private int di = 1;// 几底几花

	private boolean hasHunzi;
	private boolean canDianpaoHu;
	private boolean hasFeng;// 是否有风

	private int ma = 0;// 买马
	private boolean hasPao;
	private boolean gangpao;
	private boolean zhuangJiadi;
	private boolean ganghuaBei;
	private boolean qiduiBei;

	public boolean isHasHunzi() {
		return hasHunzi;
	}

	public void setHasHunzi(boolean hasHunzi) {
		this.hasHunzi = hasHunzi;
	}

	public boolean isCanDianpaoHu() {
		return canDianpaoHu;
	}

	public void setCanDianpaoHu(boolean canDianpaoHu) {
		this.canDianpaoHu = canDianpaoHu;
	}

	public boolean isHasFeng() {
		return hasFeng;
	}

	public void setHasFeng(boolean hasFeng) {
		this.hasFeng = hasFeng;
	}
	public int getMaima() {
		return ma;
	}

	public void setMaima(int ma) {
		this.ma = ma;
	}
	public boolean isHasPao() {
		return hasPao;
	}

	public void setHasPao(boolean hasPao) {
		this.hasPao = hasPao;
	}

	public boolean isGangpao() {
		return gangpao;
	}

	public void setGangpao(boolean gangpao) {
		this.gangpao = gangpao;
	}

	public boolean isZhuangJiadi() {
		return zhuangJiadi;
	}

	public void setZhuangJiadi(boolean zhuangJiadi) {
		this.zhuangJiadi = zhuangJiadi;
	}

	public boolean isGanghuaBei() {
		return ganghuaBei;
	}

	public void setGanghuaBei(boolean ganghuaBei) {
		this.ganghuaBei = ganghuaBei;
	}

	public boolean isQiduiBei() {
		return qiduiBei;
	}

	public void setQiduiBei(boolean qiduiBei) {
		this.qiduiBei = qiduiBei;
	}

	// ==============
	public RoomMode getRoomMode() {
		return roomMode;
	}

	public boolean isZuo5Kui() {
		return false;
	}

	public int getNnType() {
		return nnType;
	}

	public void setNnType(int nnType) {
		this.nnType = nnType;
	}

	public int getBeiTop() {
		return beiTop;
	}

	public void setBeiTop(int beiTop) {
		this.beiTop = beiTop;
	}

	public void setRoomType(int roomType) {
		this.roomType = roomType;
	}

	public void setRoomMode(RoomMode roomMode) {
		this.roomMode = roomMode;
	}

	public boolean isCanChi() {
		return false;
	}

	public boolean hasFeng() {
		return hasFeng;
	}

	public void setHaveFeng(boolean hasFeng) {
		this.hasFeng = hasFeng;
	}

	public int getMaxLunNum() {
		return maxLunNum;
	}

	public void setMaxLunNum(int maxLunNum) {
		this.maxLunNum = maxLunNum;
	}

	public boolean isCanQiangAnGang() {
		return false;
	}

	public int getBetLimit() {
		return betLimit;
	}

	public int getDi() {
		return di;
	}

	public int getHua() {
		return hua;
	}

	public int getDiFen() {
		return 1;
	}

	public void setBetLimit(int betLimit) {
		this.betLimit = betLimit;
	}

	public int getMenNum() {
		return menNum;
	}

	public void setMenNum(int menNum) {
		this.menNum = menNum;
	}

	public void setUserNum(int userNum) {
		this.userNum = userNum;
	}

	public int getUserNum() {
		return userNum;
	}

	public void setHua(int hua) {
		this.hua = hua;
	}

	public void setDi(int di) {
		this.di = di;
	}

	public boolean isAa() {
		return isAa;
	}

	public void setAa(boolean isAa) {
		this.isAa = isAa;
	}

	public boolean isZimoFanFan() {
		return isZimoFanFan;
	}

	// public int getZhaDanTop() {
	// return zhaDanTop;
	// }
	//
	// public void setZhaDanTop(int zhaDanTop) {
	// this.zhaDanTop = zhaDanTop;
	// }

	public void setZimoFanFan(boolean isZimoFanFan) {
		this.isZimoFanFan = isZimoFanFan;
	}

	public int getJoinPrice() {
		if (isAa) {
			return 1;
		}
		return 0;
	}

	public int getPrice() {
		if (isAa) {
			return 1;
		}
		int p = getTotalPrice();
		return p;
	}

	private int getTotalPrice() {
		if (roomType == CardContants.GAMETYPE_SH) {
			int[] mj = GameSetting.getInstance().getMjModeGolds();
			if (roomMode == RoomMode.Round2) {
				return mj[0];
			}
			return mj[1];
		}
		if (roomType == CardContants.GAMETYPE_Ddz) {
			int[] ddz = GameSetting.getInstance().getDdzModeGolds();
			if (roomMode == RoomMode.Round2) {
				return ddz[0];
			}
			return ddz[1];
		}
		if (roomType == CardContants.GAMETYPE_Pdk) {
			int[] pdk = GameSetting.getInstance().getPdkModeGolds();
			if (roomMode == RoomMode.Round2) {
				return pdk[0];
			}
			return pdk[1];
		}
		if (roomType == CardContants.GAMETYPE_TGG) {
			int[] zjh = GameSetting.getInstance().getZjhModeGolds();
			if (roomMode == RoomMode.Ju8) {
				return zjh[0];
			}
			if (roomMode == RoomMode.Ju16) {
				return zjh[1];
			}
			return zjh[2];
		}
		if (roomType == CardContants.GAMETYPE_Nn) {
			int[] nn = GameSetting.getInstance().getNnModeGolds();
			if (roomMode == RoomMode.Ju10) {
				return nn[0];
			}
			if (roomMode == RoomMode.Ju20) {
				return nn[1];
			}
			return nn[2];
		}
		return 1;
	}

	public int getMaxPlayNum() {
		if (roomMode == RoomMode.Round2) {
			return 4;
		}
		if (roomMode == RoomMode.Round4) {
			return 8;
		}
		if (roomMode == RoomMode.Ju16) {
			return 16;
		}

		if (roomMode == RoomMode.Ju10) {
			return 10;
		}
		if (roomMode == RoomMode.Ju20) {
			return 20;
		}
		if (roomMode == RoomMode.Ju30) {
			return 30;
		}
		if (roomMode == RoomMode.Ju32) {
			return 32;
		}
		if (roomMode == RoomMode.Ju4) {
			return 4;
		}
		if (roomMode == RoomMode.Ju5) {
			return 5;
		}
		if (roomMode == RoomMode.Ju8) {
			return 8;
		}
		return 8;
	}

	// //
	// public static List<RoomSetting> getRoomSettiongs(){
	// return nul;
	//
	// }
	// @Override
	// public int compareTo(RoomSetting o) {
	// // TODO Auto-generated method stub
	// return 0;
	// }
}
